<?php 
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$formuser = $this->formfilter;
$url_foundation = $this->url(array('module'=>'foundation','controller'=>'user','action'=>'index',));
$url_foundation_edit = $this->url(array('module'=>'foundation','controller'=>'user','action'=>'edit-user',));
$url_foundation_add = $this->url(array('module'=>'foundation','controller'=>'user','action'=>'add-user',));
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$session_user=new Zend_Session_Namespace('auth');
$request=Zend_Controller_Front::getInstance()->getRequest();
$user_info = new Application_Model_DbTable_DbGetUserInfo();
$result = $user_info->getUserInfo();
?>
<style>
.dataTables_length{ padding:10px 0 0 10px;}
.dataTables_info{ padding:10px 0 0 10px;}
.dataTables_filter{ float: right; padding-right:10px; padding-top:10px;}
.dataTables_paginate,paging_simple_numbers{ float: right; padding-right:10px; padding-top:10px;}
.navbar-right{margin: 4px;}
tr{font-size: 15px;}
td{font-size: 14px;}
</style>
<link href="<?php echo $this->baseUrl()?>/css/bootstrap.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/css/font-awesome.min.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/css/font-awesome.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
<link href="<?php echo $this->baseUrl(); ?>/css/sb-admin.css" rel="stylesheet">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0">
	<a  style="border: 0; margin-top:-12px;" class="navbar-brand" href="<?php echo $this->baseUrl(); ?>/foundation"><img src="<?php echo $this->baseUrl(); ?>/images/logo_download.gif" width="30"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
	<a style="border: 0; margin-top: 12px;" href="<?php echo $this->baseUrl(); ?>/foundation">
		<button class="btn btn-primary" style="border: 0; margin-top: 12px;"><i class="fa fa-backward"></i> &nbsp; Back</button>
	</a>
   <div class="navbar-header">
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
       <span class="sr-only">Toggle navigation</span>
       <span class="icon-bar"></span>
       <span class="icon-bar"></span>
       <span class="icon-bar"></span>
       </button>
   </div>
            <!-- /.navbar-header -->
   <ul class="nav navbar-top-links navbar-right">
      <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">
            <i class="fa fa-user fa-fw"></i> <?php echo ucwords(strtolower($session_user->fullname));?>  <i class="fa fa-caret-down"></i>
          </a>
          <ul class="dropdown-menu dropdown-user">
          	<li><a href="<?php echo $url_foundation_add;?>"><i class="fa fa-user fa-fw"></i> Add New User</a></li>
          	<?php $url_profile = $this->url(array('module'=>'foundation','controller'=>'index','action'=>'profile','id'=>$session_user->user_id,null)); ?>
             <li><a href="<?php echo $url_profile;?>"><i class="fa fa-user fa-fw"></i> User Profile</a></li>
             <li><a href="<?php echo $this->url(array('module'=>'foundation','controller'=>'user','action'=>'edit-user', 'id'=>$session_user->user_id,null));?>"><i class="fa fa-gear fa-fw"></i> Settings</a></li>
             <li class="divider"></li>
             <li><a href="<?php echo $this->url(array('module'=>'','controller'=>'index','action'=>'logout', 'value'=>1));?>"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
          </ul>
        <!-- /.dropdown-user -->
     </li>
 <!-- /.dropdown -->
    </ul>
     <!-- /.navbar-top-links -->
</nav>
<form action="<?php echo $url_foundation;?>" method="post" id="frm">
    <div id="wrapper">
      <div id="page-wrapper">

        <div class="row"  style=" width:100%; margin:0 auto" >
          <div class="row">
               <div class="col-lg-12">
                   <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>User Name</th>
                                            <th>Created Date</th>
                                            <th>Published</th>
                                            <th>Edit</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach ($formuser as $userform){?>
                                        <tr>
                                            <td><?php echo $userform["user_id"];?></td>
                                            <td><a href="<?php echo $url_foundation_edit."/id/".$userform["user_id"]?>" ><?php echo $userform["username"];?></a></td>
                                            <td><?php echo $userform["created_date"];?></td>
                                            <td>
                                            	<?php 
                                            	if($userform["status"]==1){ ?> 
                                            		<button name="status" value="<?php echo $userform["user_id"]?>" class="btn btn-info btn-circle"><i class="fa fa-check"></i></button> 
                                            	<?php }
                                            	if($userform["status"]==0){?>
                                            		<button name="unstatus" value="<?php echo $userform["user_id"]?>" class="btn btn-danger"><i class="fa fa-times"></i></button>
                                            
                                            	<?php }?>
                                            </td>
                                            <td>
                                            	<a href="<?php echo $url_foundation_edit."/id/".$userform["user_id"]?>">
                                            		<button type="button" class="btn btn-success"><i class="fa fa-check-circle-o"></i></button>
                                            	</a>
                                            </td>
                                        </tr>
                    				<?php }?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
             <!-- /.col-lg-6 -->
        </div><!-- /#page-row -->
      </div><!-- /#page-wrapper -->
	</div>
  </div><!-- /#wrapper -->
</form> 
</div>
</div><!-- end of .view_tb_right -->
    <script src="<?php echo $this->baseUrl(); ?>/js/jquery-1.10.2.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/bootstrap.min.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Page-Level Plugin Scripts - Tables -->
    <script src="<?php echo $this->baseUrl(); ?>/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/plugins/dataTables/dataTables.bootstrap.js"></script>

    <!-- SB Admin Scripts - Include with every page -->
    <script src="<?php echo $this->baseUrl(); ?>/js/sb-admin.js"></script>

    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script>
	    $(document).ready(function() {
	        $('#dataTables-example').dataTable();
	    });
    </script>